import React from 'react'
import { connect } from 'react-redux'
 function ReduxStore(props) {
  return (
    <>
    <div>{props.msg}</div>
      <button onClick={props.changeMsg}>修改msg</button>
    </>
  )
}
const mapStateToProps =(state)=>{
    return {
        msg: state.msg
    }
}
const mapDispatchToProps =(dispatch)=>{
  return {
    changeMsg(){
      const action = {type:'changeMsgFn',value:'程少商yyds'}
      dispatch(action)
    }
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(ReduxStore)